Integrand size = 21, antiderivative size = 74 \[ \int \cot ^2(c+d x) (a+a \sin (c+d x))^2 \, dx=-\frac {a^2 x}{2}-\frac {2 a^2 \text {arctanh}(\cos (c+d x))}{d}+\frac {2 a^2 \cos (c+d x)}{d}-\frac {a^2 \cot (c+d x)}{d}+\frac {a^2 \cos (c+d x) \sin (c+d x)}{2 d} \]
-1/2*a^2*x-2*a^2*arctanh(cos(d*x+c))/d+2*a^2*cos(d*x+c)/d-a^2*cot(d*x+c)/d +1/2*a^2*cos(d*x+c)*sin(d*x+c)/d
Time = 0.29 (sec) , antiderivative size = 94, normalized size of antiderivative = 1.27 \[ \int \cot ^2(c+d x) (a+a \sin (c+d x))^2 \, dx=-\frac {a^2 \csc \left (\frac {1}{2} (c+d x)\right ) \sec \left (\frac {1}{2} (c+d x)\right ) \left (7 \cos (c+d x)+\cos (3 (c+d x))+4 \left (c+d x-4 \cos (c+d x)+4 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )-4 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )\right ) \sin (c+d x)\right )}{16 d} \]
-1/16*(a^2*Csc[(c + d*x)/2]*Sec[(c + d*x)/2]*(7*Cos[c + d*x] + Cos[3*(c + d*x)] + 4*(c + d*x - 4*Cos[c + d*x] + 4*Log[Cos[(c + d*x)/2]] - 4*Log[Sin[ (c + d*x)/2]])*Sin[c + d*x]))/d
Time = 0.29 (sec) , antiderivative size = 78, normalized size of antiderivative = 1.05, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3042, 3188, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \cot ^2(c+d x) (a \sin (c+d x)+a)^2 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {(a \sin (c+d x)+a)^2}{\tan (c+d x)^2}dx\) |
\(\Big \downarrow \) 3188 |
\(\displaystyle \frac {\int \left (\csc ^2(c+d x) a^4-\sin ^2(c+d x) a^4+2 \csc (c+d x) a^4-2 \sin (c+d x) a^4\right )dx}{a^2}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {-\frac {2 a^4 \text {arctanh}(\cos (c+d x))}{d}+\frac {2 a^4 \cos (c+d x)}{d}-\frac {a^4 \cot (c+d x)}{d}+\frac {a^4 \sin (c+d x) \cos (c+d x)}{2 d}-\frac {a^4 x}{2}}{a^2}\) |
(-1/2*(a^4*x) - (2*a^4*ArcTanh[Cos[c + d*x]])/d + (2*a^4*Cos[c + d*x])/d - (a^4*Cot[c + d*x])/d + (a^4*Cos[c + d*x]*Sin[c + d*x])/(2*d))/a^2
3.3.79.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*tan[(e_.) + (f_.)*(x_)]^(p_ ), x_Symbol] :> Simp[a^p Int[ExpandIntegrand[Sin[e + f*x]^p*((a + b*Sin[e + f*x])^(m - p/2)/(a - b*Sin[e + f*x])^(p/2)), x], x], x] /; FreeQ[{a, b, e, f}, x] && EqQ[a^2 - b^2, 0] && IntegersQ[m, p/2] && (LtQ[p, 0] || GtQ[m - p/2, 0])
Time = 0.18 (sec) , antiderivative size = 80, normalized size of antiderivative = 1.08
method | result | size |
derivativedivides | \(\frac {a^{2} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+2 a^{2} \left (\cos \left (d x +c \right )+\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )\right )+a^{2} \left (-\cot \left (d x +c \right )-d x -c \right )}{d}\) | \(80\) |
default | \(\frac {a^{2} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+2 a^{2} \left (\cos \left (d x +c \right )+\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )\right )+a^{2} \left (-\cot \left (d x +c \right )-d x -c \right )}{d}\) | \(80\) |
parallelrisch | \(-\frac {a^{2} \left (\cot \left (\frac {d x}{2}+\frac {c}{2}\right ) \cos \left (2 d x +2 c \right )-2 \cot \left (\frac {d x}{2}+\frac {c}{2}\right ) \cos \left (d x +c \right )-2 \sec \left (\frac {d x}{2}+\frac {c}{2}\right ) \csc \left (\frac {d x}{2}+\frac {c}{2}\right )+2 d x -8 \cos \left (d x +c \right )+5 \cot \left (\frac {d x}{2}+\frac {c}{2}\right )-8 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )-8\right )}{4 d}\) | \(102\) |
risch | \(-\frac {a^{2} x}{2}-\frac {i a^{2} {\mathrm e}^{2 i \left (d x +c \right )}}{8 d}+\frac {a^{2} {\mathrm e}^{i \left (d x +c \right )}}{d}+\frac {a^{2} {\mathrm e}^{-i \left (d x +c \right )}}{d}+\frac {i a^{2} {\mathrm e}^{-2 i \left (d x +c \right )}}{8 d}-\frac {2 i a^{2}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}-\frac {2 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d}+\frac {2 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d}\) | \(138\) |
norman | \(\frac {-\frac {a^{2}}{2 d}+\frac {a^{2} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}-\frac {a^{2} \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}+\frac {a^{2} \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}-\frac {a^{2} x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2}-a^{2} x \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {a^{2} x \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}-\frac {4 a^{2} \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {4 a^{2} \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}+\frac {2 a^{2} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}\) | \(200\) |
1/d*(a^2*(1/2*cos(d*x+c)*sin(d*x+c)+1/2*d*x+1/2*c)+2*a^2*(cos(d*x+c)+ln(cs c(d*x+c)-cot(d*x+c)))+a^2*(-cot(d*x+c)-d*x-c))
Time = 0.26 (sec) , antiderivative size = 105, normalized size of antiderivative = 1.42 \[ \int \cot ^2(c+d x) (a+a \sin (c+d x))^2 \, dx=-\frac {a^{2} \cos \left (d x + c\right )^{3} + 2 \, a^{2} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - 2 \, a^{2} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) + a^{2} \cos \left (d x + c\right ) + {\left (a^{2} d x - 4 \, a^{2} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{2 \, d \sin \left (d x + c\right )} \]
-1/2*(a^2*cos(d*x + c)^3 + 2*a^2*log(1/2*cos(d*x + c) + 1/2)*sin(d*x + c) - 2*a^2*log(-1/2*cos(d*x + c) + 1/2)*sin(d*x + c) + a^2*cos(d*x + c) + (a^ 2*d*x - 4*a^2*cos(d*x + c))*sin(d*x + c))/(d*sin(d*x + c))
\[ \int \cot ^2(c+d x) (a+a \sin (c+d x))^2 \, dx=a^{2} \left (\int \cos ^{2}{\left (c + d x \right )} \csc ^{2}{\left (c + d x \right )}\, dx + \int 2 \sin {\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )} \csc ^{2}{\left (c + d x \right )}\, dx + \int \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )} \csc ^{2}{\left (c + d x \right )}\, dx\right ) \]
a**2*(Integral(cos(c + d*x)**2*csc(c + d*x)**2, x) + Integral(2*sin(c + d* x)*cos(c + d*x)**2*csc(c + d*x)**2, x) + Integral(sin(c + d*x)**2*cos(c + d*x)**2*csc(c + d*x)**2, x))
Time = 0.28 (sec) , antiderivative size = 79, normalized size of antiderivative = 1.07 \[ \int \cot ^2(c+d x) (a+a \sin (c+d x))^2 \, dx=\frac {{\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} a^{2} - 4 \, {\left (d x + c + \frac {1}{\tan \left (d x + c\right )}\right )} a^{2} + 4 \, a^{2} {\left (2 \, \cos \left (d x + c\right ) - \log \left (\cos \left (d x + c\right ) + 1\right ) + \log \left (\cos \left (d x + c\right ) - 1\right )\right )}}{4 \, d} \]
1/4*((2*d*x + 2*c + sin(2*d*x + 2*c))*a^2 - 4*(d*x + c + 1/tan(d*x + c))*a ^2 + 4*a^2*(2*cos(d*x + c) - log(cos(d*x + c) + 1) + log(cos(d*x + c) - 1) ))/d
Leaf count of result is larger than twice the leaf count of optimal. 143 vs. \(2 (70) = 140\).
Time = 0.34 (sec) , antiderivative size = 143, normalized size of antiderivative = 1.93 \[ \int \cot ^2(c+d x) (a+a \sin (c+d x))^2 \, dx=-\frac {{\left (d x + c\right )} a^{2} - 4 \, a^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) - a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + \frac {4 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + a^{2}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )} + \frac {2 \, {\left (a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 4 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 4 \, a^{2}\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{2}}}{2 \, d} \]
-1/2*((d*x + c)*a^2 - 4*a^2*log(abs(tan(1/2*d*x + 1/2*c))) - a^2*tan(1/2*d *x + 1/2*c) + (4*a^2*tan(1/2*d*x + 1/2*c) + a^2)/tan(1/2*d*x + 1/2*c) + 2* (a^2*tan(1/2*d*x + 1/2*c)^3 - 4*a^2*tan(1/2*d*x + 1/2*c)^2 - a^2*tan(1/2*d *x + 1/2*c) - 4*a^2)/(tan(1/2*d*x + 1/2*c)^2 + 1)^2)/d
Time = 9.83 (sec) , antiderivative size = 201, normalized size of antiderivative = 2.72 \[ \int \cot ^2(c+d x) (a+a \sin (c+d x))^2 \, dx=\frac {2\,a^2\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}+\frac {-3\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+8\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+8\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-a^2}{d\,\left (2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}+\frac {a^2\,\mathrm {atan}\left (\frac {a^4}{4\,a^4+a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}-\frac {4\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{4\,a^4+a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,d} \]
(2*a^2*log(tan(c/2 + (d*x)/2)))/d + (8*a^2*tan(c/2 + (d*x)/2)^3 - 3*a^2*ta n(c/2 + (d*x)/2)^4 - a^2 + 8*a^2*tan(c/2 + (d*x)/2))/(d*(2*tan(c/2 + (d*x) /2) + 4*tan(c/2 + (d*x)/2)^3 + 2*tan(c/2 + (d*x)/2)^5)) + (a^2*atan(a^4/(4 *a^4 + a^4*tan(c/2 + (d*x)/2)) - (4*a^4*tan(c/2 + (d*x)/2))/(4*a^4 + a^4*t an(c/2 + (d*x)/2))))/d + (a^2*tan(c/2 + (d*x)/2))/(2*d)